/* 全局样式优化 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* 导航栏样式优化 */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* 搜索框样式优化 */
.search-container {
    width: 100%;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-box {
    width: 60%;
    max-width: 700px;
    display: flex;
    position: relative;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    outline: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-box input:focus {
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box button:hover {
    background-color: #c0392b;
    transform: translateY(-50%) scale(1.05);
}

.search-box button i {
    font-size: 1.1rem;
}

/* 用户信息样式优化 */
.user-info {
    background-color: transparent !important;
}

.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 25px;
    transition: all 0.5s ease;
}

.user-avatar-container:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--secondary-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    color: var(--text-color);
    font-weight: 500;
}

.avatar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 0.5rem;
    display: none;
    min-width: 150px;
}

.user-avatar-container:hover .avatar-dropdown {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    nav {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .search-box {
        width: 90%;
    }

    .user-name {
        display: none;
    }
}

.hero {
    text-align: center;
    /* padding: 4rem 2rem; */
    background-color: #f4f4f4;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.menu-categories {
    margin: 2rem 0;
    text-align: center;
}

.category-btn {
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border: none;
    background-color: #f4f4f4;
    cursor: pointer;
}

.category-btn.active {
    background-color: #007bff;
    color: white;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* 模态框基础样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal .close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal .close:hover {
    color: #333;
}

/* 按钮样式 */
.modal .submit-btn,
.modal .cancel-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.modal .submit-btn {
    background-color: #007bff;
    color: white;
}

.modal .submit-btn:hover {
    background-color: #0056b3;
}

.modal .cancel-btn {
    background-color: #6c757d;
    color: white;
    margin-right: 1rem;
}

.modal .cancel-btn:hover {
    background-color: #545b62;
}

/* 轮播图样式 */
.carousel-section {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
}

.slide-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.slide-content p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background: white;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
    }

    .slide-content h2 {
        font-size: 1.5rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
    }
}